﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _100Doors
{
    public class Doors
    {
        public uint numberOfDoors;
        public bool[] listOfDoors { get; set; }
        

        public Doors()
        {
            numberOfDoors = 100;
            listOfDoors = new bool[numberOfDoors];

            for (int i = 0; i < numberOfDoors; i++)
            {
                listOfDoors[i] = false;
            }
        }

        public void Pass(int numberOfPasses)
        {
            if (numberOfPasses == 0) { return; };

            for (int j = 1; j <= numberOfPasses; j++)
            {
                for (int i = 0; i < numberOfDoors; i = i + j)
                {
                    listOfDoors[i] = !listOfDoors[i];
                }
            }
        }
    }
}
